package com.yfp.operation.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfp.operation.domain.DeviceComboPlanNumDO;
import com.yfp.operation.domain.dto.ComboSalesDO;
import com.yfp.operation.domain.dto.ComboSalesDTO;
import com.yfp.operation.domain.dto.ComboSalesPositionDTO;
import com.yfp.operation.domain.vo.ComboSalesPositionVO;
import com.yfp.operation.domain.vo.PlanNumVO;
import com.yfp.operation.mapper.DeviceComboPlanNumMapper;
import com.yfp.operation.service.DeviceComboPlanNumService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
* @author admin
* @description 针对表【device_combo_plan_count】的数据库操作Service实现
* @createDate 2024-05-14 14:21:56
*/
@Service
public class DeviceComboPlanNumServiceImpl extends ServiceImpl<DeviceComboPlanNumMapper, DeviceComboPlanNumDO> implements DeviceComboPlanNumService {

    @Resource
    private DeviceComboPlanNumMapper deviceComboPlanNumMapper;

    @Transactional
    @Override
    public void insert(DeviceComboPlanNumDO deviceComboPlanNumDO) {
        deviceComboPlanNumMapper.insert(deviceComboPlanNumDO);
    }

    @Transactional
    @Override
    public void updateCount(DeviceComboPlanNumDO countDO) {
        deviceComboPlanNumMapper.updateCount(countDO);
    }

    @Override
    public Integer getByMachineId(String machineId) {
        return deviceComboPlanNumMapper.getByMachineId(machineId);
    }

    @Transactional
    @Override
    public void batchUpdate(ArrayList<DeviceComboPlanNumDO> dcpnList) {
        deviceComboPlanNumMapper.batchUpdate(dcpnList);
    }

    @Override
    public List<PlanNumVO> getAll(String machineId) {
        return deviceComboPlanNumMapper.getAll(machineId);
    }

    @Transactional
    @Override
    public void insertAll(ArrayList<DeviceComboPlanNumDO> deviceComboPlanNumDOS) {
        deviceComboPlanNumMapper.insertAll(deviceComboPlanNumDOS);
    }

    @Override
    public void deleteByMachineId(String machineId) {
        deviceComboPlanNumMapper.deleteByMachineId(machineId);
    }

    /**
     * 获取投放记录
     * @param machineId
     * @return
     */
    @Override
    public List<DeviceComboPlanNumDO> getByMacineId(String machineId) {
        return deviceComboPlanNumMapper.getByMacineId(machineId);
    }

    @Override
    public List<String> getCPlanComboIds(String machineId) {
        return deviceComboPlanNumMapper.getCPlanComboIds(machineId);
    }

    @Override
    public DeviceComboPlanNumDO getDayByMacineId(String machineId) {
        return deviceComboPlanNumMapper.getDayByMacineId(machineId);
    }

    @Override
    public DeviceComboPlanNumDO getDayFirstByMacineId(String machineId) {
        return deviceComboPlanNumMapper.getDayFirstByMacineId(machineId);
    }

    @Override
    public List<ComboSalesDO> getComboSalesList(ComboSalesDTO comboSalesDTO) {
        return deviceComboPlanNumMapper.getComboSalesList(comboSalesDTO);
    }

    @Override
    public List<ComboSalesPositionVO> getComboSalesPositionList(ComboSalesPositionDTO comboSalesDTO) {
        return deviceComboPlanNumMapper.getComboSalesPositionList(comboSalesDTO);
    }
}




